package com.ym.medical.service;

import com.ym.core.utils.tkmybatis.IBaseSV;
import com.ym.medical.domain.entity.OrderFlowRecordEntity;
import com.ym.medical.domain.param.OrderFlowRecordParam;

import java.util.List;

/**
 * 订单流转记录Service接口
 *
 * @author ym
 * @date 2020-08-24
 */
public interface IOrderFlowRecordSV extends IBaseSV<OrderFlowRecordEntity> {

	/**
	 * 新增
	 *
	 * @param orderFlowRecord
	 * @return
	 */
	long save(OrderFlowRecordEntity orderFlowRecord);

	/**
	 * 根据ID查找
	 *
	 * @param id
	 * @return
	 */
	OrderFlowRecordEntity findById(long id);

	/**
	 * 根据model查找
	 *
	 * @param orderFlowRecordModel
	 * @return
	 */
	OrderFlowRecordEntity findByModel(OrderFlowRecordParam orderFlowRecordModel);

	/**
	 * 根据model列表查找
	 *
	 * @param orderFlowRecordModel
	 * @return
	 */
	List<OrderFlowRecordEntity> list(OrderFlowRecordParam orderFlowRecordModel);

	/**
	 * 查询相关订单最新的流转记录
	 *
	 * @param orderId 订单ID
	 * @return
	 */
	OrderFlowRecordEntity findNewByOrderId(Long orderId);

	/**
	 * 更新订单最新的流转记录
	 *
	 * @param orderFlowRecord 要更新的流转
	 * @return
	 */
	void updateNewByOrderId(OrderFlowRecordEntity orderFlowRecord);
}
